package top.vanchor.flexible.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;

/**
 * <p>
 * 
 * </p>
 *
 * @author Ding
 * @since 2022-01-27
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class BackAuthGroup implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 角色id
     */
    @JsonProperty("id")
    @TableId(value = "g_id", type = IdType.AUTO)
    private Integer groupId;

    /**
     * 角色名称
     */
    @JsonProperty("title")
    @TableField("title")
    private String title;

    /**
     * 角色描述
     */
    @JsonProperty("describe")
    @TableField(value = "`describe`")
    private String describe;

    /**
     * 角色状态：-1删除，0禁用，1正常
     */
    @JsonProperty("status")
    @TableField(value = "`status`")
    private Integer status;

    /**
     * 身份：ROLE_ADMIN / ROLE_USER
     */
    @JsonProperty("role")
    @TableField("role")
    private String role;

    /**
     * 角色权限
     */
    @JsonProperty("rules")
    @TableField("rules")
    private String rules;

    /**
     * 创建时间
     */
    @JsonProperty("createTime")
    @TableField("create_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone = "Asia/Shanghai")
    private Date createTime;

    /**
     * 修改时间
     */
    @JsonProperty("updateTime")
    @TableField("update_time")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern ="yyyy-MM-dd", timezone = "Asia/Shanghai")
    private Date updateTime;

}
